package com.bl.student.dao.model;

import com.bl.student.common.enums.GoodsType;
import com.bl.student.common.enums.OnlineStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by liangweikang on 18/1/29.
 */
@Entity
@Data
@Table(name = "GOODS")
@ApiModel(value = "GoodsEntity", description = "商品")
@DynamicInsert
@DynamicUpdate
public class GoodsEntity {
    @Id
    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "商品图")
    private String image;

    @ApiModelProperty(value = "名字")
    private String title;

    @ApiModelProperty(value = "简介")
    private String description;

    @ApiModelProperty(value = "权重")
    private int weight;

    @ApiModelProperty(value = "价格")
    private int point;

    @ApiModelProperty(value = "数量")
    @Column(name = "num")
    private int num;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    @Column(name = "update_time")
    private Date updateTime;

    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "状态")
    private OnlineStatus status;

    @ApiModelProperty(value = "长图")
    @Column(name = "long_image")
    private String longImage;

}
